import Vue from 'vue'
import Vuex from 'vuex'
import state from './state'
import mutations from './mutations'
import actions from './action'
import getters from './getters'
//  1.安装插件
Vue.use(Vuex)

// const state = {
//   cartList:[] ,//存储购物车里面的商品
 
// }

// 2.创建Store对象
const store = new Vuex.Store({
  state,
  mutations,
  actions,
  getters
})

// 3.导出store,挂载到Vue实例上
export default store